import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia';
import piniaPersistedstate from 'pinia-plugin-persistedstate';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import {hasPerm} from "./control/permission/hasPerm.ts";

// 创建一个应用
const app = createApp(App)
// 创建pinia
const pinia = createPinia();
pinia.use(piniaPersistedstate)
// 注册全局指令
app.directive('hasPerm', hasPerm);

app.use(router).use(pinia)

// elementPlus 图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// 将应用挂载到app容器中
app.mount('#app')
